#ifndef WREN_EDITOR_EXTENSION_HPP
#define WREN_EDITOR_EXTENSION_HPP

#include "scripting/scripting_api.h"
#include "wren_base.hpp"
#include <string_view>

class WrenEditorExtension final: public IEditorScript, WrenScriptBase {
private:
    WrenEditorExtension(EditorTarget type, std::string title, const std::string &script_path);
    ~WrenEditorExtension();
public:
    void execute(const void *data) override;

    static IScript* create(EditorTarget target, std::string title, const std::string_view &code, const std::string &script_path);

private:
    bool compile(const std::string_view& code) const;
};

#endif /* WREN_EDITOR_EXTENSION_HPP */
